package com.zhilianbao.leyaogo.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

import com.zhilianbao.leyaogo.constants.PushConfig;

/**
 * ClassName: NotificationReceiver <br>
 * Description: 通知点击Receiver<br>
 * Author: Cyarie <br>
 * Created: 2016/8/29 13:44 <br>
 * Update Time：<br>
 * Update Description：<br>
 */
public class NotificationClickReceiver extends BroadcastReceiver {


    /**
     * 点击通知栏触发
     *
     * @param context
     * @param intent
     */
    @Override
    public void onReceive(Context context, Intent intent) {
        if (intent.getAction() != null && intent.getAction().equals(PushConfig.ACTION_CLICK_NOTIFICATION) && intent.getExtras() != null) {

            //打开应用
//            Intent launchIntent = RobotApplication.getContext().getPackageManager().
            //                    getLaunchIntentForPackage("com.bql.eyeshow");
            //            launchIntent.setFlags(
            //                    Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_RESET_TASK_IF_NEEDED);
            //            Bundle bundle = new Bundle();
            //            bundle.putString(PushConfig.PUSH_LAUNCHER, "launcher");
            //            bundle.putInt(PushConfig.PUSH_CLIK, 1);
            //            launchIntent.putExtras(bundle);
            //            RobotApplication.getContext().startActivity(launchIntent, bundle);

        }

    }
}
